﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Store.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<YourStore.Models.Order>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Order List
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Order List</h2>

    <table class="admin">
        <tr>
        <td>
        </td>
            <th>
                OrderId
            </th>
            <th>
                OrderDate
            </th>
            <th>
                Username
            </th>
            <th>
                FirstName
            </th>
            <th>
                LastName
            </th>
            <th>
                Address
            </th>
            <th>
                City
            </th>
            <th>
                Phone
            </th>
            <th>
                Email
            </th>
            <th>
                Total
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
        <td>
           
            <%: Html.ActionLink("Details", "OrderDetailsNew", new { id=item.OrderId })%> </td>
            <td>
                <%: item.OrderId %>
            </td>
            <td>
                <%:  item.OrderDate.ToString("dd-MM-yyyy") %>
            </td>
            <td>
                <%: item.Username %>
            </td>
            <td>
                <%: item.FirstName %>
            </td>
            <td>
                <%: item.LastName %>
            </td>
            <td>
                <%: item.Address %>
            </td>
            <td>
                <%: item.City %>
            </td>
            <td>
                <%: item.Phone %>
            </td>
            <td>
                <%: item.Email %>
            </td>
            <td>
               $ <%: String.Format("{0:F}", item.Total) %>
            </td>
        </tr>
    
    <% } %>

    </table>
   </asp:Content>





